﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Marmat.Forms
{
    public partial class SearchControl
    {
        public class FieldItem
        {
            /// <summary>
            /// 字段名
            /// </summary>
            public ISearchControlField Field { get; set; }

            /// <summary>
            /// 字段值
            /// </summary>
            public string Value { get; set; }

            public override string ToString()
            {
                string field = string.IsNullOrEmpty(this.Field.Caption) ? this.Field.Name : this.Field.Caption;
                if (this.Field is SearchControl.Group)
                    return $"筛选于：{field}";
                else
                    return $"搜索 {field}为：" + this.Value;
            }
        }
    }
}
